package com.qf.lyw1225.springboot.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qf.lyw1225.springboot.entity.User;
import com.qf.lyw1225.springboot.dao.LqUserMapper;
import com.qf.lyw1225.springboot.service.LqUserService;
import com.qf.lyw1225.springboot.utils.Result;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @User userlq
 * @Date 2024/12/25 11:29
 * @Classname LqUserServiceImpl
 * @Description TODO
 */
@Service
public class LqUserServiceImpl extends ServiceImpl<LqUserMapper, User> implements LqUserService {

    @Resource
    LqUserMapper lqUserMapper;

    @Override
    public Result deleteById(Integer id) {
        int i = lqUserMapper.deleteById(id);
        if (i > 0) {
            return Result.success();
        } else {
            return Result.error("删除失败");
        }
    }

    @Override
    public Result insert(User user) {
        int insert = lqUserMapper.insert(user);
        if (insert > 0) {
            return Result.success();
        } else {
            return Result.error("修改失败");
        }
    }
}
